<template>
  <div ref="echarts" class="echarts"></div>
</template>

<script>
import {reqAdminEcharts3} from '../../../../api'
export default {
    name:"Echarts3",
    async mounted() {
        const reqData = await reqAdminEcharts3() //获取请求的数据
        const echarts = this.$refs.echarts //获取dom
        const echartsChart = this.$echarts.init(echarts) //绑定dom
        const option = {
            title: {text: '各类别商品成交量'},
            tooltip: {}, 
            series:{
                type:"pie",
                roseType:'area',
                data:reqData
            }
        }
        option && echartsChart.setOption(option);
    }
}
</script>

<style scoped>
    .echarts{
        width: 490px;
        height: 295px;
        border-radius: 8px;
        background: white;
        float: left;
        margin-right: 10px;
        margin-bottom: 10px;
        padding: 20px 10px;
    }
</style>